<!doctype html>
<html>
<head>
	<meta charset="utf-8"><meta name="format-detection" content="telephone=no">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
	<title>机构</title>
	<link rel="stylesheet" type="text/css" href="../../lib/css/skin.css"/>
</head>
<body>
<div id="root">
	<div class="app_warp">
		<div class="app_head">
			<span class="left back"></span>
			<span class="name">机构详情</span>
		</div>
		<div id="mechanism_view" class="app_main">
			<div class="nocontent animated fadeInUp">
				<img src="../../lib/img/loading.gif" class="minimize" alt="">
				<div class="text minimize">
					准备数据
				</div>
			</div>
		</div>
	</div>
</div>

<script id="mechanism_view_template" type="text/html">
	<div class="animated fadeInUp">
	<div class="topbg mechanism">
		<img class="imgcache" src="<%:=img%>" data_src="<%:=data.avatar%>" alt="">
		<span class="name"><%:=data.name%></span>
		<span class="intro">
			<%:getAreaName=data.s_province%> /
			<% for(var i in data.classid){ %>
				<%:getClassifyName=data.classid[i]%>
			<% } %>
		</span>
	</div>
	<div class="space"></div>
	<div class="app_box">
		<div class="box_tit">
			<span class="name">
				精品课程
			</span>
		</div>
		<div class="box_cont">
			<% for(var i in data.tcourse){ var _i_ = data.tcourse[i]%>
			<ul class="mechanism_classlist">
				<li tapmode onclick="_$.viewClassIntro(this,<%:=_i_.id%>)" class="in">
					<span class="class_name">
						<%:=_i_.name%>
					</span>
					<span class="class_content">
						<%:subStr=[_i_.content,22]%>
					</span>
					<span class="class_cost">
						<b><%:=_i_.cost%></b>元/课程
					</span>
					<span class="class_num">
						已报名<%:=_i_.num%>
					</span>
				</li>
			</ul>
			<% } %>
		</div>
	</div>

	<div class="app_box">
		<div class="box_tit">
			<span class="name">
				机构简介
			</span>
		</div>
		<div class="box_cont">

			<% if(data.slide!==null){ %>
			<div class="mechanism_swiper">
				<div class="swiper-container">
					<div class="swiper-wrapper">
						<% for(var i in data.slide){ %>
						<div class="swiper-slide">
							<img src="<%:=data.slide[i]%>" style="width: 100%;height: auto;">
						</div>
						<%}%>
					</div>
					<div class="swiper-pagination"></div>
				</div>
			</div>
			<% } %>
			<ul class="mechanism_view_list clearfix" data_id="<%:=data.id%>">
				<li>
					<span class="tit">
						教授
					</span>
					<span class="val">
						<% for(var i in data.classid){ %>
							<%:getClassifyName=data.classid[i]%>
						<% } %>
					</span>
				</li>
				<li>
					<span class="tit">
						地址
					</span>
					<span class="val">
						<%:=data.address%>
					</span>
				</li>
				<li>
					<span class="tit">
						电话
					</span>
					<span class="val">
						<%:=data.tel%>
					</span>
				</li>
				<li>
					<span class="tit">
						简介
					</span>
					<span class="val">
						<%:=data.intro%>
					</span>
				</li>
				<li>
					<span class="tit">
						认证
					</span>
					<span class="val">
						<%:=data.addtime%> 在艺考平台认证机构
					</span>
				</li>
			</ul>
		</div>
	</div>
<% if(data.mood!==null){ %>
	<div class="app_box">
		<div class="box_tit">
			<span class="name">
				机构帖子
			</span>
		</div>
	</div>

	<ul class="list_item sociality_list clearfix">
		<%for(var i in data.mood) {
		var _data_ = data.mood[i];
		%>
		<li class="<%:getClassid=_data_.classid%>" tapmode onclick="_$.viewArtcircle(this,<%:=_data_.id%>)">
			<img class="sociality_pic imgcache" src="<%:=img%>" data_src="<%:=_data_.avatar%>" alt="">
			<span class="sociality_username">
				<%:=_data_.author%>
			</span>
			<span class="sociality_date">
				<%:=_data_.date%>
			</span>
			<span class="sociality_zan <%:=_data_.zan.end===true?'active':'unactive'%>">
				<%:=_data_.zan.num%>
			</span>
			<span class="sociality_comment">
				<%:=_data_.comment===null?0:_data_.comment.length%>
			</span>
			<div class="sociality_cont clearfix">
				<%:=_data_.intro%>
			</div>
			<div class="sociality_imgs clearfix">
				<%for(var j in _data_.pics) { var _pics_ = _data_.pics[j]%>
				<img class="imgcache" src="<%:=img%>" data_src="<%:=_pics_.thumb%>"
				     picture="<%:=_pics_.picture%>" alt="">
				<%}%>
			</div>
		</li>
		<%}%>
	</ul>

<% }else{ %>
	<div class="app_box">
		<div class="box_tit">
			<span class="name">
				机构帖子
			</span>
		</div>
		<div class="box_cont">
			<div class="nocontent minisize animated fadeInUp">
				<img src="../../lib/img/nocomment.png" class="minimize" alt="">
				<div class="text minimize">
					本机构还没有发过帖
				</div>
			</div>
		</div>
	</div>
<% } %>
	</div>
</script>

<script>
	var appready = function () {
		_$.ajax({
			interface:'getMechanismDetails',
			data:{
				id:api.pageParam.id
			},
			call:function(data){
				_$.db.get({
					key:'area',
					call:function(data){
						window.__areaData__ = data;
					}
				})
				_$.template('mechanism_view_template',{data:data.data,img:_$.imgCache.default},function(html){
					_$.sleep(function(){
						$('#mechanism_view').html(html);
						_$.imgCache.load();
						var swiper = new Swiper('.swiper-container', {
							pagination: '.swiper-pagination',
							loop: true
						});
					},1000)
				})
			}
		})
	};
</script>
<script src="../../lib/js/config.js"></script>
<script src="../../lib/js/jquery.js"></script>
<script src="../../lib/js/common.js"></script>
<script src="../../lib/js/swiper.js"></script>
<script>

</script>
</body>
</html>